/**
 * Created by weikexin .
 * description:
 **/
import { HTTP } from '../util/http'

class RedPacket extends HTTP {

  getPacketRule (success) {
    let url = 'PacketSet/queryRule'
    this.request({
      url: url,
      success
    })
  }

  getPacketRuleByName (params={}, success) {
    let url = 'PacketSet/queryPacketSetByName'
    this.request({
      url: url,
      success,
      data: params
    })
  }

  getMyPacket (success) {
    let url = 'CollectManagement/queryMyPacket'
    this.request({
      url: url,
      success
    })
  }

  getPacketSize (success) {
    let url = 'PacketSet/queryPacketSetList'
    this.request({
      url: url,
      success
    })
  }

  getPacketDetail (params={}, success) {
    let url = 'user/queryPacketDetail'
    let data = Object.assign({},
        params,
        {
            count: 10
        })
    this.request({
        url: url,
        data: data,
        success,
        method: 'POST'
    })
}

  withdraw (params = {}, success) {
    let url = 'Alipay/alipayWithdraw'
    let data = Object.assign({},
      params)
    this.request({
      url: url,
      data: data,
      success,
      method: 'POST'
    })
  }
}
export { RedPacket }

